package other.nowcoder.easy;

import java.util.Scanner;

/**
 * @author bruin_du
 * @description 统计每个月兔子的总数
 * https://www.nowcoder.com/practice/1221ec77125d4370833fd3ad5ba72395?
 * tpId=37&&tqId=21260&rp=1&ru=/activity/oj&qru=/ta/huawei/question-ranking
 * @date 2022/5/16 11:43
 **/
public class CountRabbit {
    public static void main(String[] args) {
        //所以第n个月兔子总数： f(n) = f(n - 1) + f(n - 2)
        //在变相考察斐波那契数列。
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int n = in.nextInt();
            if(n <= 2)
                System.out.println(1);
            else{
                int[] arr = new int[50];
                arr[0] = 1;
                arr[1] = 1;
                for(int i = 2 ; i < n ; i++){
                    arr[i] += arr[i - 1] + arr[i - 2];
                }
                System.out.println(arr[n - 1]);
            }
        }
    }
}
